package com.sigmatrix.h5.feign.args;

import java.util.ArrayList;
import java.util.List;

import com.sigmatrix.h5.utils.SessionUtils;

public class InStorageParam {
	
	List<Detail> detailList;
	
	public static class Detail{
		private String dealerCode;
		private String parentCode;
		private String enterpriseCode;
		private String productCode;
		
		private Short tag;
		
		private Integer userId;
		
		private List<Code> qrCodeList;

		public Short getTag() {
			return tag;
		}

		public void setTag(Short tag) {
			this.tag = tag;
		}

		public Integer getUserId() {
			return userId;
		}

		public void setUserId(Integer userId) {
			this.userId = userId;
		}

		public List<Code> getQrCodeList() {
			return qrCodeList;
		}

		public void setQrCodeList(List<Code> qrCodeList) {
			this.qrCodeList = qrCodeList;
		}

		public String getDealerCode() {
			return dealerCode;
		}

		public void setDealerCode(String dealerCode) {
			this.dealerCode = dealerCode;
		}

		public String getProductCode() {
			return productCode;
		}

		public void setProductCode(String productCode) {
			this.productCode = productCode;
		}

		public String getEnterpriseCode() {
			return enterpriseCode;
		}

		public void setEnterpriseCode(String enterpriseCode) {
			this.enterpriseCode = enterpriseCode;
		}

		public String getParentCode() {
			return parentCode;
		}

		public void setParentCode(String parentCode) {
			this.parentCode = parentCode;
		}
	}
	
	public static class Code{
		private String code;

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}
	}

	public List<Detail> getDetailList() {
		return detailList;
	}

	public void setDetailList(List<Detail> detailList) {
		this.detailList = detailList;
	}
	
	public static InStorageParam build(String dealerCode,String parentCode,String productCode,Short tag,Integer userId,String qrCode){
		InStorageParam param = new InStorageParam();
		List<Detail> detailList = new ArrayList<Detail>();
		Detail detail = new Detail();
		detail.setDealerCode(dealerCode);
		detail.setProductCode(productCode);
		detail.setParentCode(parentCode);
		detail.setTag(tag);
		detail.setUserId(userId);
		detail.setEnterpriseCode(SessionUtils.getEseCode());
		List<Code> qrCodeList = new ArrayList<Code>();
		Code code = new Code();
		code.setCode(qrCode);
		qrCodeList.add(code);
		detail.setQrCodeList(qrCodeList);
		detailList.add(detail);
		param.setDetailList(detailList);
		return param;
	}
}
